home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / kcl / akcl / akcl.lha / akcl / V / c / read.d < prev    next >
Text File  |  1990-04-09  |  7KB  |  485 lines

  1. Changes file for /usr/local/src/kcl/c/read.d
  2. Created on Mon Apr  9 09:37:10 1990
  3. Usage \n@s[Original text\n@s|Replacement Text\n@s]
  4. See the file rascal.ics.utexas.edu:/usr2/ftp/merge.c
  5. for a program to merge change files.  Anything not between
  6. "\n@s[" and  "\n@s]" is a simply a comment.
  7. This file was constructed using emacs and  merge.el
  8. Enhancements Copyright (c) W. Schelter All rights reserved.
  9.    by (Bill Schelter)  wfs@carl.ma.utexas.edu 
  10.  
  11.  
  12. ****Change:(orig (15 15 c))
  13. @s[object standard_readtable;
  14.  
  15. @s|
  16.  
  17. @s]
  18.  
  19.  
  20. ****Change:(orig (18 21 d))
  21. @s[object Vreadtable;
  22. object Vread_default_float_format;
  23. object Vread_base;
  24. object Vread_suppress;
  25.  
  26. @s|
  27. @s]
  28.  
  29.  
  30. ****Change:(orig (23 44 d))
  31. @s[object Kstart;
  32. object Kend;
  33. object Kradix;
  34. object Kjunk_allowed;
  35.  
  36. @s,object big_register_0;
  37.  
  38.  
  39. @s|
  40. @s]
  41.  
  42.  
  43. ****Change:(orig (48 48 c))
  44. @s[#define    SHARP_EQ_CONTEXT_SIZE    64
  45.  
  46. @s|#define    SHARP_EQ_CONTEXT_SIZE    250
  47.  
  48. @s]
  49.  
  50.  
  51. ****Change:(orig (68 68 d))
  52. @s[int sharp_eq_context_max;
  53.  
  54. @s|
  55. @s]
  56.  
  57.  
  58. ****Change:(orig (152 152 a))
  59. @s[read_object_recursive(in)
  60.  
  61. @s|read_object_recursive(in)
  62. object in;
  63.  
  64. @s]
  65.  
  66.  
  67. ****Change:(orig (340 340 a))
  68. @s[    setup_standard_READ();
  69.  
  70.     frs_push(FRS_PROTECT, Cnil);
  71.     if (nlj_active) {
  72.         e = TRUE;
  73.         goto L;
  74.     }
  75.  
  76.     x = read_object(in);
  77.     vs_push(x);
  78.  
  79.     if (sharp_eq_context_max > 0)
  80.         x = vs_head = patch_sharp(x);
  81.  
  82.     e = FALSE;
  83.  
  84. L:
  85.     frs_pop();
  86.  
  87.     READtable = old_READtable;
  88.     READdefault_float_format = old_READdefault_float_format;
  89.     READbase = old_READbase;
  90.     READsuppress = old_READsuppress;
  91.     sharp_eq_context_max = old_sharp_eq_context_max;
  92.     for (i = 0;  i < sharp_eq_context_max;  i++)
  93.         sharp_eq_context[i] = old_sharp_eq_context[i];
  94.     backq_level = old_backq_level;
  95.     if (e) {
  96.         nlj_active = FALSE;
  97.         unwind(nlj_fr, nlj_tag);
  98.     }
  99.     vs_pop;
  100.     /* BUG FIX by Toshiba */
  101.     vs_pop;
  102.     return(x);
  103. }
  104.  
  105. @s|    setup_standard_READ();
  106.  
  107.     frs_push(FRS_PROTECT, Cnil);
  108.     if (nlj_active) {
  109.         e = TRUE;
  110.         goto L;
  111.     }
  112.  
  113.     x = read_object(in);
  114.     vs_push(x);
  115.  
  116.     if (sharp_eq_context_max > 0)
  117.         x = vs_head = patch_sharp(x);
  118.  
  119.     e = FALSE;
  120.  
  121. L:
  122.     frs_pop();
  123.  
  124.     READtable = old_READtable;
  125.     READdefault_float_format = old_READdefault_float_format;
  126.     READbase = old_READbase;
  127.     READsuppress = old_READsuppress;
  128.     sharp_eq_context_max = old_sharp_eq_context_max;
  129.     for (i = 0;  i < sharp_eq_context_max;  i++)
  130.         sharp_eq_context[i] = old_sharp_eq_context[i];
  131.     backq_level = old_backq_level;
  132.     if (e) {
  133.         nlj_active = FALSE;
  134.         unwind(nlj_fr, nlj_tag);
  135.     }
  136.     vs_pop;
  137.     /* BUG FIX by Toshiba */
  138.     vs_pop;
  139.     return(x);
  140. }
  141. #ifdef UNIX  /* faster code for inner loop from file stream */
  142. #define read_char_to(res,in,eof_code) \
  143.   do{FILE *fp; \
  144.       if(fp=in->sm.sm_fp) \
  145.     {int ch = getc(fp); \
  146.        if(ch==EOF && feof(fp)) \
  147.          {eof_code;} \
  148.        else res=code_char(ch);} \
  149.       else \
  150.     { if (stream_at_end(in)) \
  151.         {eof_code;} \
  152.     else res=read_char(in);}} while(0)
  153. #else
  154. #define read_char_to(res,in,eof_code) \
  155.   if(stream_at_end(in)) {eof_code ;} \
  156.   else res=read_char(in)
  157. #endif
  158.  
  159. @s]
  160.  
  161.  
  162. ****Change:(orig (372 380 c))
  163. @s[    do {
  164.         if (stream_at_end(in)) {
  165.             if (df) {
  166.                 vs_reset;
  167.  
  168. @s,        }
  169.         c = read_char(in);
  170.  
  171. @s|    do { read_char_to(c,in, {
  172.       if (df) {
  173.         vs_reset;
  174.         return(OBJNULL);
  175.       } else
  176.         end_of_stream(in);
  177.     });
  178.  
  179. @s]
  180.  
  181.  
  182. ****Change:(orig (430 432 c))
  183. @s[        if (stream_at_end(in))
  184.             goto M;
  185.         c = read_char(in);
  186.  
  187. @s|        read_char_to(c,in,goto M);
  188.  
  189. @s]
  190.  
  191.  
  192. ****Change:(orig (494 494 c))
  193. @s[    token->st.st_fillp = length;
  194.     if (escape_flag)
  195.  
  196. @s|    token->st.st_fillp = length;
  197.     if (escape_flag || (READbase<=10 && token_buffer[0]>'9'))
  198.  
  199. @s]
  200.  
  201.  
  202. ****Change:(orig (601 601 a))
  203. @s[     (i) == 'b' || (i) == 'B')
  204.  
  205.  
  206. @s|     (i) == 'b' || (i) == 'B')
  207.  
  208. double pow();
  209.  
  210. @s]
  211.  
  212.  
  213. ****Change:(orig (769 781 c))
  214. @s[    fraction_unit = 1.0;
  215.     while (d > 0)
  216.         if (d%2 == 0) {
  217.             d /= 2;
  218.  
  219. @s,        fraction /= fraction_unit;
  220.  
  221. @s|    /* Use pow because it is more accurate */
  222.     fraction = fraction * pow(10.0,(double)(sign * d));
  223.  
  224. @s]
  225.  
  226.  
  227. ****Change:(orig (785 785 c))
  228. @s[    if ((*(int *)&fraction & 0x7ff00000) == 0x7ff00000)
  229.  
  230. @s|    if ((*((int *)&fraction +HIND) & 0x7ff00000) == 0x7ff00000)
  231.  
  232. @s]
  233.  
  234.  
  235. ****Change:(orig (1021 1021 c))
  236. @s[Lsemicolon_reader()
  237. {
  238.     object c;
  239.  
  240.  
  241. @s|Lsemicolon_reader()
  242. {
  243.     object c;
  244.     object str= vs_base[0];
  245.  
  246. @s]
  247.  
  248.  
  249. ****Change:(orig (1025 1026 c))
  250. @s[        c = read_char(vs_base[0]);
  251.     while (char_code(c) != '\n');
  252.  
  253. @s|    { read_char_to(c,str, goto L); }
  254.         while (char_code(c) != '\n');
  255. L:    
  256.  
  257. @s]
  258.  
  259.  
  260. ****Change:(orig (1370 1370 a))
  261. @s[    vs_pop;
  262.     if (READsuppress) {
  263.  
  264. @s|    vs_pop;
  265.     if (READsuppress) {
  266.         read_object(vs_base[0]);    
  267.  
  268. @s]
  269.  
  270.  
  271. ****Change:(orig (1385 1385 a))
  272. @s[    vs_pop;
  273.     if (READsuppress) {
  274.  
  275. @s|    vs_pop;
  276.     if (READsuppress) {
  277.         read_object(vs_base[0]);
  278.  
  279. @s]
  280.  
  281.  
  282. ****Change:(orig (1627 1627 a))
  283. @s[    case t_vector:
  284.     {
  285.         int i;
  286.  
  287.  
  288. @s|    case t_vector:
  289.     {
  290.         int i;
  291.  
  292.         if ((enum aelttype)x->v.v_elttype != aet_object)
  293.           break;
  294.  
  295.  
  296. @s]
  297.  
  298.  
  299. ****Change:(orig (1634 1634 a))
  300. @s[    case t_array:
  301.     {
  302.         int i, j;
  303.  
  304. @s|    case t_array:
  305.     {
  306.         int i, j;
  307.         
  308.         if ((enum aelttype)x->a.a_elttype != aet_object)
  309.           break;
  310.  
  311. @s]
  312.  
  313.  
  314. ****Change:(orig (1641 1641 a))
  315. @s[            x->a.a_self[i] = patch_sharp(x->a.a_self[i]);
  316.         break;
  317.     }
  318.  
  319. @s|            x->a.a_self[i] = patch_sharp(x->a.a_self[i]);
  320.         break;
  321.     }
  322.     case t_structure:
  323.     {object def = x->str.str_def;
  324.      int i;
  325.      i=S_DATA(def)->length;
  326.      while (i--> 0)
  327.        structure_set(x,def,i,patch_sharp(structure_ref(x,def,i)));
  328.      break;
  329.        }
  330.     
  331.  
  332. @s]
  333.  
  334.  
  335. ****Change:(orig (1757 1757 c))
  336. @s[                /*  structure assignment  */
  337.     }
  338.  
  339. @s|                /*  structure assignment  */
  340.     } else
  341.      rtab=to->rt.rt_self;
  342.  
  343. @s]
  344.  
  345.  
  346. ****Change:(orig (1759 1759 c))
  347. @s[        if (rtab[i].rte_dtab != NULL) {
  348.  
  349. @s|        if (from->rt.rt_self[i].rte_dtab != NULL) {
  350.  
  351. @s]
  352.  
  353.  
  354. ****Change:(orig (1930 1930 c))
  355. @s[    for (;;) {
  356.         c = read_char(strm);
  357.  
  358. @s|    for (;;) {
  359.             read_char_to(c,strm,c = Ct; goto FINISH);
  360.  
  361. @s]
  362.  
  363.  
  364. ****Change:(orig (1938 1941 d))
  365. @s[        if (stream_at_end(strm)) {
  366.             c = Ct;
  367.             break;
  368.         }
  369.  
  370. @s|
  371. @s]
  372.  
  373.  
  374. ****Change:(orig (1942 1942 a))
  375. @s[    }
  376.  
  377. @s|    }
  378.  FINISH:
  379.  
  380. @s]
  381.  
  382.  
  383. ****Change:(orig (1944 1944 c))
  384. @s[    @(return `copy_simple_string(token)` c)
  385.  
  386. @s|  /* no disadvantage to returning an adjustable string */
  387.   
  388.   {object uu= copy_simple_string(token);
  389. /*   uu->st.st_hasfillp=TRUE;
  390.    uu->st.st_adjustable=TRUE;
  391. */
  392.    @(return uu c)
  393.    }
  394.  
  395. @s]
  396.  
  397.  
  398. ****Change:(orig (2125 2125 a))
  399. @s[    @(return `make_fixnum(c)`)
  400. @)
  401.  
  402.  
  403. @s|    @(return `make_fixnum(c)`)
  404. @)
  405.  
  406. object
  407. read_byte1(str,eof)
  408. object str,eof;
  409. {if (stream_at_end(str))
  410.    return eof;
  411.  return make_fixnum(readc_stream(str));}
  412.  
  413. object
  414. read_char1(str,eof)
  415. object str,eof;
  416. {if (stream_at_end(str))
  417.    return eof;
  418.  return code_char(readc_stream(str));}
  419.  
  420.  
  421.  
  422. @s]
  423.  
  424.  
  425. ****Change:(orig (2283 2283 c))
  426. @s[    detect_eos_flag = FALSE;
  427.     x = read_object(in);
  428.  
  429. @s|    detect_eos_flag = FALSE;
  430.     x = read_object_non_recursive(in);
  431.  
  432. @s]
  433.  
  434.  
  435. ****Change:(orig (2531 2531 a))
  436. @s[    make_si_function("STANDARD-READTABLE", siLstandard_readtable);
  437. }
  438.  
  439.  
  440. @s|    make_si_function("STANDARD-READTABLE", siLstandard_readtable);
  441. }
  442.  
  443. object siSPinit;
  444.  
  445. @s]
  446.  
  447.  
  448. ****Change:(orig (2534 2534 c))
  449. @s[object
  450. read_fasl_vector(in)
  451.  
  452. @s|object
  453. read_fasl_vector1(in)
  454.  
  455. @s]
  456.  
  457.  
  458. ****Change:(orig (2590 2591 c))
  459. @s[    }    
  460.     x = alloc_simple_vector(dimcount, aet_object);
  461.  
  462. @s|    }
  463.     if(dimcount==1 && type_of(vs_head)==t_vector)
  464.       {/* new style where all read at once */
  465.         x=vs_head;
  466.         goto DONE;}
  467.     /* old style separately sharped, and no %init */
  468.     x=alloc_simple_vector(dimcount,aet_object);
  469.  
  470. @s]
  471.  
  472.  
  473. ****Change:(orig (2596 2597 c))
  474. @s[        x->v.v_self[dim] = vsp[dim];
  475.  
  476.  
  477. @s|        {SGC_TOUCH(x);
  478.          x->cfd.cfd_self[dim] = vsp[dim];}
  479.     
  480.          
  481.       DONE:
  482.  
  483. @s]
  484.  
  485.